package com.example.applicationevent;

import com.example.applicationevent.listener.DemoPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ApplicationEventApplication implements ApplicationRunner {

    @Autowired
    private DemoPublisher demoPublisher;

    public static void main(String[] args) {
        SpringApplication.run(ApplicationEventApplication.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        demoPublisher.publish("hello application event");


    }
}
